﻿/* v0.0.1 2016-09-20 by howard */
/**
* 获取手机系统信息 env.os
*/
/**
*howardSelfOsParam的结果集列表
*isIOS:true
*isIPad:false
*isIPhone:true
*name:"iPhone"
*version:"9.1"
*/
;(function(paramWindow,howardSelfOsParam) {
	howardSelfOsParam.env = howardSelfOsParam.env || {};
    var _paramOsInfo, _paramUserAgent = paramWindow.navigator.userAgent;
    if (_paramOsInfo = _paramUserAgent.match(/Windows\sPhone\s(?:OS\s)?([\_paramUserAgent\.]+)/)) howardSelfOsParam.env.os = {
        name: "Windows Phone",
        isWindowsPhone: !0,
        version: _paramOsInfo[1]
    };
    else if (_paramUserAgent.match(/Safari/) && (_paramOsInfo = _paramUserAgent.match(/Android[\s\/]([\_paramUserAgent\.]+)/))) howardSelfOsParam.env.os = {
        version: _paramOsInfo[1]
    },
    _paramUserAgent.match(/Mobile\s+Safari/) ? (howardSelfOsParam.env.os.name = "Android", howardSelfOsParam.env.os.isAndroid = !0) : (howardSelfOsParam.env.os.name = "AndroidPad", howardSelfOsParam.env.os.isAndroidPad = !0);
    else if (_paramOsInfo = _paramUserAgent.match(/(iPhone|iPad|iPod)/)) {
        var e = _paramOsInfo[1]; (_paramOsInfo = _paramUserAgent.match(/OS ([\d_\.]+) like Mac OS X/)) && (howardSelfOsParam.env.os = {
            name: e,
            isIPhone: "iPhone" === e || "iPod" === e,
            isIPad: "iPad" === e,
            isIOS: !0,
            version: _paramOsInfo[1].split("_").join(".")
        })
    }
    howardSelfOsParam.env.os || (howardSelfOsParam.env.os = {
        name: "unknown",
        version: "0.0.0"
    }),
    howardSelfOsParam.version && (howardSelfOsParam.env.os.version = howardSelfOsParam.version(howardSelfOsParam.env.os.version))
	console.log(howardSelfOsParam);
})(window, window.howardSelfOsParam || (window.howardSelfOsParam = {}));

